Skip to content

Run RuboCop with --no-parallel - #1043

Merged
lolgab merged 1 commit into
masterfrom
rubocop-no-parallel
Dec 3, 2026
Merged

lolgab merged 1 commit into
masterfrom
rubocop-no-parallel

Conversation

@lolgab

@lolgab lolgab commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

RuboCop turns --parallel on by itself when every CLI option is in its default-parallel list (ours all are) and the active config doesn't set AllCops: UseCache: false. That happens for runs that use the repo's own .rubocop.yml / .rubocop-codacy.yml: RuboCop then forks one worker per CPU it sees, and with no CPU limit on the pod that is the node's 16–64 cores, each worker paying for its own copy of the ~18 loaded plugins against the 250Mi memory limit.

  • The wrapper now passes --no-parallel, so RuboCop always inspects files in a single process, whichever config is used.
  • Runs with the Codacy UI-generated config (UseCache: false) were already serial; nothing changes for them.

--no-parallel sets parallel: false, so parallel_by_default! (RuboCop 1.92.3 lib/rubocop/cli.rb:152-161) no longer switches it on, and the runner's run_in_parallel? returns false.

Same fix as codacy/codacy-opengrep#50.

  • After deploy, 7 days: rubocop ToolOutOfMemory count and run-time p99 vs the 7 days before

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@lolgab
lolgab marked this pull request as ready for review December 3, 2026 10:26
@lolgab
lolgab enabled auto-merge December 3, 2026 10:26

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

✅ No blocking issues noticed

No blocking findings identified.

Test suggestions

  • Verify the constructed RuboCop command contains --no-parallel for repository and generated configuration paths.
  • Verify existing configuration, pattern, and file arguments are still included when --no-parallel is added.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify the constructed RuboCop command contains `--no-parallel` for repository and generated configuration paths.
2. Verify existing configuration, pattern, and file arguments are still included when `--no-parallel` is added.

TIP Add review instructions in .codacy/instructions/review.md, or an AGENTS.md, so the reviewer knows your conventions.
TIP How was this review? Give us feedback

@lolgab
lolgab merged commit 55d160c into master Dec 3, 2026
4 checks passed
@lolgab
lolgab deleted the rubocop-no-parallel branch December 3, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants